Repository navigation
Report MOSEK's solution status from the lifted SDPs - #13
Open
avinashresearch1 wants to merge 1 commit into
Open
avinashresearch1 wants to merge 1 commit into
avinashresearch1 wants to merge 1 commit into
Conversation
The MOSEK-backed monolithic and chordal SDPs report MOSEK's problem status, but not its solution status, and solve() returns true whenever MOSEK returns. A solve that MOSEK stopped early, for example at optimizerMaxTime, could not be told apart from one that converged. Add solutionStatus() to both, next to problemStatus(). It returns MOSEK's primal solution status from the last solve, Optimal when MOSEK converged and Unknown when it stopped early, and throws before solve(). Wrap it for Python and test it in C++ and Python, including a solve stopped by a zero time limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #12 (borglab#2960), which is stacked on borglab#2959. Its branch
avi/stereo-localization-exampleis the base here, so this PR shows only its own commit.The MOSEK-backed
LiftedSDPProblem<MonolithicSDP, MosekSDPSolver>andLiftedSDPProblem<ChordalSDP, MosekSDPSolver>report MOSEK's problem status but not its solution status, andsolve()returns true whenever MOSEK returns. A solve that MOSEK stopped early, for example atoptimizerMaxTime, therefore cannot be told apart from one that converged. This PR addsto both, next to
problemStatus(). It returns MOSEK's primal solution status from the last solve:SolutionStatus::Optimalwhen MOSEK converged, andSolutionStatus::Unknownwhen it stopped early. LikeproblemStatus(), it throws beforesolve(). Both are wrapped for Python.The change only adds API. A benchmark that certifies its solutions can now count a run as certified only when MOSEK reports an optimal solution.
Tests
testLiftedSDPs.cpp: the newSolutionStatustest checks, for both formulations, that the status throws before a solve, readsOptimalafter a converged solve, and readsUnknownafter a solve stopped by a zerooptimizerMaxTime.test_certifiable.py: the MOSEK wrapper test checks the same through Python.MosekMonolithicSDP.ipynblists the new accessor with the others.Validation
CI does not build MOSEK and does not run on my fork, so I ran the checks locally on Ubuntu 24.04 with GCC 13.3, MOSEK 11.2 and Python 3.12:
check.certifiable, with MOSEKSolutionStatustesttest_certifiable.pyafterpython-install, with MOSEKGTSAM_BUILD_WITH_WERROR=ONclang-tidy-diff.pyon the changed lines, with a MOSEK compilation databasescripts/check_code_quality.pyand its self-test,git diff --checkThe MOSEK build had
-Werroroff: with MOSEK on, GCC 13 reports a spurious-Warray-boundsinSubstituteFixedVariablesinLiftedSDPProblem.cppondevelop. This PR does not touch that function.🤖 Posted by an AI agent · harness: Claude Code 2.1.325 (cli) · model: claude-opus-5-5
Review: unreviewed
Session: local Claude Code session abf6b61e-d2bb-4e00-913a-038009f6811d